<?php
/*
 * @Author: 李明
 * @Date: 2021-09-25 11:42:35
 * @LastEditTime: 2022-01-14 08:57:54
 * @LastEditors: 李明
 * @Description: 
 * @FilePath: /CRM2.0-PHP/app/Models/MessageRecord.php
 * @山东壹零贰肆信息科技有限公司
 */

/**
 * Created by Reliese Model.
 */

namespace App\Models;

use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;

/**
 * Class MessageRecord
 * 
 * @property int $id
 * @property string|null $content
 * @property int|null $company_id
 * @property string|null $ihuyi_id
 * @property string|null $phone_num
 * @property int|null $count
 * @property int|null $record_worker_id
 * @property int|null $worker_id
 * @property int|null $user_id
 * @property int|null $order_id
 * @property int|null $message_model_id
 * @property int|null $interest_id
 * @property string|null $status
 * @property string|null $why
 * @property string|null $remark
 * @property string|null $company
 * @property Carbon|null $create_time
 * @property Carbon|null $update_time
 * 
 * @property MessageModel|null $message_model
 *
 * @package App\Models
 */
class MessageRecord extends Model
{
    protected $connection = 'mysql_sms';
    protected $table = 'message_record';

    protected $casts = [
        'company_id' => 'int',
        'count' => 'int',
        'record_worker_id' => 'int',
        'worker_id' => 'int',
        'user_id' => 'int',
        'order_id' => 'int',
        'message_model_id' => 'int',
        'interest_id' => 'int'
    ];

    protected $fillable = [
        'content',
        'company_id',
        'ihuyi_id',
        'phone_num',
        'count',
        'record_worker_id',
        'worker_id',
        'user_id',
        'order_id',
        'message_model_id',
        'interest_id',
        'status',
        'why',
        'remark',
        'company'
    ];

    public function message_model()
    {
        return $this->belongsTo(MessageModel::class);
    }
}
